"""
@author: 江同学呀
@file: search_multiple_indices.py
@date: 2025/1/24 22:35
@desc:
    https://www.elastic.co/guide/en/elasticsearch/reference/7.17/search-multiple-indices.html
"""
from typing import Union, Dict

from espc.common.common import Number
from espc.orm.model.base.base import _Base
from espc.orm.model.model.base_alias import BaseAlias
from espc.orm.model.model.base_index import BaseIndex


class IndicesBoost(_Base):
    """
    指数提升
    """
    def __init__(self, index: Union[str, BaseIndex, BaseAlias], boost: Number):
        super().__init__()
        self._index: Union[str, BaseIndex, BaseAlias] = index
        self._boost: Number = boost
        return

    def _build(self) -> Dict:
        return {
            self._index: self._boost
        }
